/*
 *------------------------------------------------------------------------------
 * @File      :    ei_mai_nna.h
 * @Date      :    2021-4-8
 * @Author    :    lomboswer <lomboswer@lombotech.com>
 * @Brief     :    Media InterPNV for MADP(Media Development Platform).
 *
 * Copyright (C) 2020-2021, LomboTech Co.Ltd. All rights reserved.
 *------------------------------------------------------------------------------
 */

#ifndef __EI_NNA_PNV_DET_DEFINE_H__
#define __EI_NNA_PNV_DET_DEFINE_H__

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

#include "ei_nna_define.h"

#define DEFAULT_NNA_PNV_DET_CONFIG_MAX_DET_CNT (30)
#define DEFAULT_NNA_PNV_DET_CONFIG_IMAGE_FORMAT (YUV420_SP)

#define DEFAULT_NNA_PNV_DET_CONFIG_INTERESTBOX0 (0)
#define DEFAULT_NNA_PNV_DET_CONFIG_INTERESTBOX1 (0)

#define DEFAULT_NNA_PNV_DET_CONFIG_CAR_DET_SIZE_RANGE0 (0)
#define DEFAULT_NNA_PNV_DET_CONFIG_CYCLE_DET_SIZE_RANGE0 (0)
#define DEFAULT_NNA_PNV_DET_CONFIG_PERSON_DET_SIZE_RANGE0 (0)

#define DEFAULT_NNA_PNV_DET_CONFIG_MAX_TRACK_CNT (30)
#define DEFAULT_NNA_PNV_DET_CONFIG_IOU_THRESH (40)
#define DEFAULT_NNA_PNV_DET_CONFIG_CONF_THRESH (2)
#define DEFAULT_NNA_PNV_DET_CONFIG_CAT_DET_EN (0)
#define DEFAULT_NNA_PNV_DET_CONFIG_CAT_CLASSIFICATION_EN (0)
#define DEFAULT_NNA_PNV_DET_CONFIG_TRK_EN (0)
#define DEFAULT_NNA_PNV_DET_CONFIG_KEEP_MODLE_MEMORY_EN (0)

#define DEFAULT_NNA_PNV_DET_CONFIG_RESOULTION_X0 (640)
#define DEFAULT_NNA_PNV_DET_CONFIG_RESOULTION_Y0 (352)

#define DEFAULT_NNA_PNV_DET_CONFIG_RESOULTION_X1 (960)
#define DEFAULT_NNA_PNV_DET_CONFIG_RESOULTION_Y1 (544)

typedef struct eiNNA_PNV_S {
	EI_S32 s32Rect[4];
	EI_FLOAT f32Score;
	EI_S32 s32RectSmooth[4];
	EI_S32 s32Id;
	EI_S32 s32TkNum;
	EI_S32 s32Orientation;
	EI_DOUBLE d32TimesTamp;
	EI_S32 s32Clolor;
	EI_S32 s32Type;
} EI_NNA_PNV_S;

typedef struct eiNNA_PNVS_CAR_S {
	EI_U32 u32Num;
	EI_NNA_PNV_S stPNVsRect[DEFAULT_NNA_PNV_DET_CONFIG_MAX_TRACK_CNT];
} EI_NNA_PNVS_CAR_S;

typedef struct eiNNA_PNVS_PERSON_S {
	EI_U32 u32Num;
	EI_NNA_PNV_S stPNVsRect[DEFAULT_NNA_PNV_DET_CONFIG_MAX_TRACK_CNT];
} EI_NNA_PNVS_PERSON_S;

typedef struct eiNNA_PNVS_CYCLE_S {
	EI_U32 u32Num;
	EI_NNA_PNV_S stPNVsRect[DEFAULT_NNA_PNV_DET_CONFIG_MAX_TRACK_CNT];
} EI_NNA_PNVS_CYCLE_S;

typedef struct eiNNA_PNVS_RESULT_S{
	EI_NNA_PNVS_CAR_S CarResult;
	EI_NNA_PNVS_PERSON_S PersonResult;
	EI_NNA_PNVS_CYCLE_S CycleResult;
} EI_NNA_PNVS_RESULRS_S;

typedef struct eiNNA_PNV_DET_CONFIG_S {
	EI_CHAR *ModelRootPath;

	EI_S32 s32ImgWidth;
	EI_S32 s32ImgHeight;
	EI_S32 s32InterestBox[4];
	EI_S32 s32MaxTrackCount;
	EI_S32 s32CarDetEn;
	EI_S32 s32CarClassificationEn;
	EI_S32 s32TrkEn;
	EI_S32 s32KeepModelMemory;
	EI_S32 s32CarDetSizeRange[2];
	EI_S32 s32CycleDetSizeRange[2];
	EI_S32 s32PersonDetSizeRange[2];
	EI_FLOAT f32confidence_threshold[5];
	EI_S32 s32Resolution; /*0: {512, 288}; 1: {640, 352}; 2:{960,544}; default: 1 */
	EI_S32 s32Model_version; /* 0:less memeory lower detection; 1:better detection bigger memory*/

	EI_S32 s32MaxDetCnt;
	EI_S32 s32ImageFormat;
} EI_NNA_PNV_DET_CONFIG_S;

typedef EI_S32 NNA_PNV_CHN;
typedef EI_NNA_PNVS_RESULRS_S EI_NNA_DST_PNVS_RESULRS_S;
typedef EI_NNA_PNV_DET_CONFIG_S EI_NNA_PNV_CONFIG_S;

#ifdef __cplusplus
}

#endif
#endif